package org.smr.ministore.service;

import org.apache.ibatis.annotations.Param;
import org.blade.utils.Pager;
import org.smr.ministore.entities.Dictionary;
import org.blade.service.base.BaseService;
import org.blade.service.base.BaseBatchService;
import org.blade.service.base.PaginationQueryService;
import org.smr.ministore.entities.DictionaryGroupQueryVO;

import java.util.List;
import java.util.Map;

/**
 * @author blade
 */
public interface DictionaryService extends BaseService<Long, Dictionary>,
        BaseBatchService<Long, Dictionary>,
        PaginationQueryService<Long, Dictionary> {

    /**
     * 获取字典组
     *
     * @param sys
     * @param bigType
     * @param organId
     * @param organPath
     * @return
     */
    List<Dictionary> getDictionaryGroup(int sys,
                                        String bigType,
                                        Long organId,
                                        String organPath);

    /**
     * 获取字典组
     *
     * @param query
     * @return
     */
    public List<Dictionary> getDictionaryGroup(DictionaryGroupQueryVO query);


    /**
     * 获取已引用的字典
     *
     * @param params :{int sys, Long organId, String bigType, Long originId}
     * @return
     */
    List<Map<String, Object>> getReferencedDictionaryList(Map<String, Object> params);

    /**
     * 获取组织引用的字典
     *
     * @param entity
     * @param pageSize
     * @param pageNum
     * @return
     */
    Pager<Dictionary> getOrganReferencedDictionaryPagination(Dictionary entity, Long pageSize, Long pageNum);

    /**
     * 查询机构所属的字典
     *
     * @param entity
     * @return List<Dictionary>
     */
    List<Dictionary> getOrganReferencedDictionary(Dictionary entity);

}
